function calculateDistance(body1, body2) {
    return Math.round(Math.sqrt(Math.pow(body1.x - body2.x, 2) + Math.pow(body1.y - body2.y, 2)));
}

function calculateEnemyNumber(num) {
    return num + grade > 0 ? num + grade : 0
}

function generateID() {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        const r = Math.random() * 16 | 0;
        const v = c === 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
}

function randomOffset(n, dpr, deviation) {
    return n + (Math.random() > 0.5 ? 1 : -1) * dpr * (Math.random() * 5 + deviation);
}

function randomAngle() {
    // 角度范围可以从0到2π弧度，即360度
    return Math.random() * 2 * Math.PI; // 产生一个0到2π之间的随机数
}

const buffColor = {
    speed: '#00FFFF',
    attack_speed: '#FF8000',
    pickup_range: '#7FFF00'
};